-- poisoning_to_attrib
-- create by wangy
-- 附加属性：转换数量毒素

return {
    apply = function(prop, baseValue)
        -- 数量
        return prop[3];
    end,

    -- 中毒触发
    trigger = function(who, prop, arg)
        local attrib = prop[2];
        local count = tonumber(prop[3]);
        local bonus = { 2, attrib, count, };

        -- 奖励
        BonusM.doBonus(bonus, "poisoning_to_attrib");

        -- 奖励事件
        EventMgr.fire(event.SKILL_BONUS, { ["bonus"] = bonus});

        -- 触发特技发动事件
        EventMgr.fire(event.SPECIAL_SKILL_TRIGGER, { propId = prop[1] });
        return true;
    end,

    desc = function(prop)
        local row = PropM.getRow(prop[1]);
        local desc = row.desc;

        desc = string.gsub(desc, "{0}", prop[3]);
        desc = string.gsub(desc, "{1}", FieldsM.getFieldName(prop[2]));

        return desc;
    end,

    record = function(target, prop, path)
        return false;
    end
};
